<template>
  <common-page :title="title">
    <el-button v-if="isShowBack" slot="header" @click="back">返回</el-button>
    <div slot="content" class="data-components-preview" :style="{padding: chartType === 'kpi-single' ? '20px' : '12px'}">
      <chart-preview  :id="id"></chart-preview>
    </div>
  </common-page>
</template>

<script>
import ChartPreview from './graph/preview'

export default {
  name: 'preview',
  props: {
    isShowBack:{
      type:Boolean,
      default:true
    },
    id: {
      type: [Number, String],
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    chartType: {
      type: String,
      default: ''
    }
  },
  components: {
    ChartPreview
  },
  data() {
    return {}
  },
  methods: {
    back() {
      this.$emit('close')
    }
  },
  mounted() {

  }

}
</script>

<style scoped lang="scss">
.data-components-preview {
  padding: 12px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
</style>
